﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.ComponentModel;
namespace WPFExcelReport
{
    public partial class TSPRG
    {

        public TSPRG()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VICC_PROGDEF();
            DataContext = MV;
            InitializeComponent();
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e); 
            if (dwMaster == null)
            { 
                KEY = ""; 
            }
            else
            {
                KEY = dwMaster["PROG"].ToString(); 
            }
        }
        
        public override void LOADALL()
        {
            dwData = TBMain.NewRow(); 
            SResult = TMV.QueryICC_PROGDEF(dwData, -2); 
            MergeData(SResult, false); 
        }
        public override void ManageCommand(object sender, RoutedEventArgs e)
        {
            if (IsManage)
                LOADALL();
            base.ManageCommand(sender, e);
        }
    }
}
